package com.classes.field;

/**
 * @author chuer
 * @version V1.0
 * @Description: 字段访问标识
 * @date 2015年4月24日 上午10:37:52
 */
public enum FiledAccessFlagEnum {
    ACC_PUBLIC(0x0001),
    ACC_PRIVATE(0x0002),
    ACC_PROTECTED(0x0004),
    ACC_STATIC(0x0008),
    ACC_FINAL(0x0010),
    ACC_VOLATILE(0x0040),
    ACC_TRANSIENT(0x0080),
    ACC_SYNTHETIC(0x1000),
    ACC_ENUM(0x4000),;

    private int flag;

    private FiledAccessFlagEnum(int flag) {
        this.flag = flag;
    }

    public int getFlag() {
        return this.flag;
    }

    public static FiledAccessFlagEnum getFlag(int flag) {
        for (FiledAccessFlagEnum fafe : FiledAccessFlagEnum.values()) {
            if (fafe.getFlag() == flag) {
                return fafe;
            }
        }
        return null;

    }

}
